<?php


/**
 * 地址管理Model
 * Enter description here ...
 * @author Admin
 *
 */
class AddressModel extends CommonModel {
	
	/**
	 * 保存
	 * Enter description here ...
	 * @param unknown_type $data
	 */
	public function insert($data){
		$data = $this->create($data,1);
		
		if (empty($data) || $data === false) {
			return  $this->getError();
		}
		
		$id  = $this->add($data);
		if ($id){
			return $id;
		}else {
			return  $this->getError();
		}
	}
	
	/**
	 * 更新
	 * Enter description here ...
	 * @param unknown_type $data
	 */
	public function update($data){
		$data = $this->create($data,2);
		if (empty($data) || $data === false) {
			return  $this->getError();
		}
		$id  = $this->save($data);
		if ($id){
			return $id;
		}else {
			return  $this->getError();
		}
	}
	
}
?>